package com.crowd.spring;

import com.crowd.MyAnnotationConfiguration;
import com.crowd.spring.entity.Employee;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class test {
    public static void main(String[] args) {

        //基于注解类配置类创建IOC容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyAnnotationConfiguration.class);

        //从IOC容器获取bean
        Employee employee = applicationContext.getBean(Employee.class);
        System.out.println(employee);

        applicationContext.close();
    }
}
